/*********************************** (C) COPYRIGHT ******************************
 * address: https://gitee.com/liuniansihuo/multitasks-os
 *
 * Change Logs:
 * Date			Author      	Notes
 * 2022-09-02	LiuHuo			first version
 *
*******************************************************************************/
#ifndef __work_base_H_
#define __work_base_H_


struct WorkQueue_Func_s
{
	void (*function)(unsigned int data);
	unsigned int data;
};

struct WorkQueue_s
{
	const unsigned short size;
	unsigned short cnt;
	struct WorkQueue_Func_s func[];//使用动态数组或灵活数组,请小心修改结构体

};

//size = struct WorkQueue_Func_s 结构体的个数
#define WORK_QUEUE_SIZE(size)	(sizeof(struct WorkQueue_s)+sizeof(struct WorkQueue_Func_s)*size)
#define WORK_QUEUE_BUFF(name,size) static unsigned char name[WORK_QUEUE_SIZE(size)] = {size,0x00}



void work_base_add_tail(struct WorkQueue_s * work,void (*function)(unsigned int data),unsigned int data);
void work_base_del(struct WorkQueue_s * work,void (*function)(unsigned int data), unsigned int data);


#endif
